<template>
  <div class="auctionbody">
    <div class="zero_list" v-for="(item, i) in info.banner" :key="i">
      <p>
        <img :src="$fnc.getImgUrl(item.piclink)" alt="">
      </p>
      <div class="zero_info">
        <p style="line-height: 24px;">{{item.title.length > 25 ? item.title.slice(0,25) + "..." : item.title}}</p>
        <div class="zero_price">
          <div class="price">
            <p>市场价：￥8.90</p>
            <p>￥<span>0.00</span></p>
          </div>
          <p class="zero_btn">马上抢</p>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {};
    },
    props: {
      info: {
        type: Object,
        default: () => ({})
      }
    },
    components: {},
    methods: {
      get_int_dec(num, type) {
        // @type  int-整数部分 ,dec - 小数部分
        num = num + "";
        num = num.toString();
        var decimal = 2;
        decimal = decimal >= 2 && decimal < 6 ? 2 : decimal;
        decimal = decimal == "0" ? 0 : decimal || 2;
        let index = num.indexOf(".");
        if (index !== -1) {
          num = num.substring(0, decimal + index + 1);
        } else {
          num = num.substring(0);
        }
        num = parseFloat(num).toFixed(decimal);
        if (type == "int") {
          return parseInt(num);
        } else if (type == "dec") {
          return "." + num.toString().split(".")[1] || ".00";
        }
      }
    }
  };
</script>
<style lang="less" scoped>
  .auctionbody {
    width: 100%;
    margin: 0 auto 15px;
    padding-bottom: 10px;
  }

  .zero_list {
    display: flex;
    background: #fff;
    // margin: 15px;
    padding: 10px;
    border-radius: 10px;

    >p {
      line-height: 1;

      img {
        max-width: 99px!important;
        max-height: 99px!important;
        border-radius: 10px;
      }
    }

    .zero_info {
      margin-left: 10px;
      font-size: 14px;

      .zero_price {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        margin-top: 10px;

        .price {
          font-size: 12px;
          color: #b8b8b8;
          line-height: 22px;

          p:nth-of-type(1) {
            text-decoration: line-through;
          }

          p:nth-of-type(2) {
            color: #ff0000;

            span {
              font-size: 18px;
              font-weight: bold;
            }
          }
        }

        .zero_btn {
          font-size: 14px;
          font-weight: bold;
          color: #fff;
          background-image: linear-gradient(to right, #ff795f, #ff4363);
          padding: 0 15px;
          border-radius: 20px;
        }
      }
    }
  }
</style>
